﻿namespace EFS.RC.Wallboard.Common.Config.Sections.Phones.Profiles.Charts
{
	public class AgentStatus
	{
		public AgentStatus(System.Configuration.ConfigurationSection section)
		{
			LoadConfig(section);
		}

		#region Properties
		/// Property Free: Get, Set
		public EFS.RC.Wallboard.Common.Config.Sections.Phones.Profiles.Charts.Limits.Limit Free { get; private set; }

		/// Property Login: Get, Set
		public EFS.RC.Wallboard.Common.Config.Sections.Phones.Profiles.Charts.Limits.Limit Login { get; private set; }

		/// Property Busy: Get, Set
		public EFS.RC.Wallboard.Common.Config.Sections.Phones.Profiles.Charts.Limits.Limit Busy { get; private set; }

		/// Property InWrap: Get, Set
		public EFS.RC.Wallboard.Common.Config.Sections.Phones.Profiles.Charts.Limits.Limit InWrap { get; private set; }
		#endregion

		#region Utilities
		/// Loads the configuration
		private void LoadConfig(System.Configuration.ConfigurationSection section)
		{
			// check
			EFS.Common.Verify.Reference(section, "section");

			// get section
			System.Collections.Specialized.NameValueCollection nvc =
				(System.Collections.Specialized.NameValueCollection)System.Configuration.ConfigurationManager.GetSection(section.SectionInformation.SectionName);
			EFS.Common.Verify.Reference(nvc, section.SectionInformation.SectionName);

			// read
			Free = EFS.RC.Wallboard.Common.Config.Sections.Phones.Profiles.Charts.Limits.Limit.Get(nvc, "Free");
			Login = EFS.RC.Wallboard.Common.Config.Sections.Phones.Profiles.Charts.Limits.Limit.Get(nvc, "Login");
			Busy = EFS.RC.Wallboard.Common.Config.Sections.Phones.Profiles.Charts.Limits.Limit.Get(nvc, "Busy");
			InWrap = EFS.RC.Wallboard.Common.Config.Sections.Phones.Profiles.Charts.Limits.Limit.Get(nvc, "InWrap");
		}
		#endregion
	}

}